import { $t } from '@/locales'
import type { Router } from 'vue-router'

// 改变网页标题
export function changeTitle(router: Router) {
  router.beforeEach((to) => {
    const { title } = to.meta
    if (title) {
      useTitle($t(title))
    }
  })
}
